/** @file
  Brief description of the file's purpose.
  Detailed description of the file's contents and other useful
  information for a person viewing the file for the first time.
  Copyright (C) 2006 - 2023, Kunlun BIOS, Kunlun Technology (Beijing) Co., Ltd.. All
  Rights Reserved.
  You may not reproduce, distribute, publish, display, perform, modify, adapt,
  transmit, broadcast, present, recite, release, license or otherwise exploit
  any part of this publication in any form, by any means, without the prior
  written permission of Kunlun Technology (Beijing) Co., Ltd..
  @par Revision Reference:18
  - PI Version 1.0
  @par Glossary:
  - IETF - Internet Engineering Task Force
  - NASA - National Aeronautics and Space Administration
**/


#ifndef _SMBIOS_OEM_LIB_H_
#define _SMBIOS_OEM_LIB_H_
#include <Uefi.h>
#include <Protocol/PiPcd.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/UefiRuntimeServicesTableLib.h>
#include <Library/BaseLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/PcdLib.h>
#include <Library/DebugLib.h>
#include <Library/PrintLib.h>

#include <Protocol/Smbios.h>
#include <IndustryStandard/SmBios.h>

#define KL_SMBIOS_MAX_DESIGNATION_STR_LEN 0x20
#define KL_SMBIOS_MAX_DP_STR_LEN          0x100


/**
  This service will be call by each time process SMBIOS string.
  OEM can provide a way to get replace string for OEM depend.

  @param[in]  Type           SMBIOS type number.
  @param[in]  StringIndex    String Index.
  @param[out] StrLength      String length.
  @param[out] String         String point.

  @retval    EFI_UNSUPPORTED       Returns unsupported by default.
  @retval    EFI_SUCCESS           N/A.
  @retval    EFI_MEDIA_CHANGED     The value of OUT parameter is changed.
**/
EFI_STATUS
OemInterfaceGetSmbiosReplaceString (
  IN  EFI_SMBIOS_TYPE   Type,
  IN  UINT8             StringIndex,
  OUT UINTN             *StrLength,
  OUT CHAR8             **String
  );

/**
  This service will be call by each time add SMBIOS record.
  OEM can modify SMBIOS record in run time.

  Notice the SMBIOS protocol is unusable when service is runing.

  @param[in, out]  *RecordBuffer         Each SMBIOS record data.
                                         The max length of this buffer is SMBIOS_TABLE_MAX_LENGTH.

  @retval    EFI_UNSUPPORTED       Returns unsupported by default.
  @retval    EFI_SUCCESS           Don't add this SMBIOS record to system.
  @retval    EFI_MEDIA_CHANGED     The value of IN OUT parameter is changed.
**/
EFI_STATUS
OemInterfaceUpdateSmbiosRecord (
  IN OUT EFI_SMBIOS_TABLE_HEADER *RecordBuffer
  );

EFI_STATUS
OemInterfaceGetUuid (
  OUT GUID       *Uuid
  );

EFI_STATUS
EFIAPI
OemInterfaceEndOfKlSmbiosDxe (
  VOID
  );

#endif
